import userinfosdb from '../entity/UserInfo';
import userDaoImpl from '../dao/UserDaoImpl';
import { Userinfo } from '../entity/UserInfo';

export class UserServiceImpl {
  userinfoDaoImpl: userDaoImpl = new userDaoImpl();
  static userServiceImpl: UserServiceImpl;
  static getInstance() {
    if (!this.userServiceImpl) {
      this.userServiceImpl = new UserServiceImpl();
    }
    return this.userServiceImpl;
  }
  constructor() {
    console.log('属性装饰器：userservice  构造器...');
  }

  Login(username: string, pwd: string): Userinfo | null {
    console.log(
      '方法装饰器进入service...Login,username:',
      username,
      'password=='
    );
    return this.userinfoDaoImpl.findUsrByUsm(username, pwd) || null;
  }
  register() {
    console.log('usersevce...register');
    // this.userinfoDaoImpl.findUsrByUsm(username, pwd);
  }
}
